<!--
 * @Author: your name
 * @Date: 2020-03-06 21:47:02
 * @LastEditTime: 2020-03-14 13:28:29
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-ele-env\src\views\RCIM-sourceStatistics\index.vue
 -->
<!--
	创建者：luyiming
	该文件用于：
	创建时间：2020-03-06 21:47:02
-->
<template>
	<div class="RCIM-sourceStatistics_view">
		<AbnormalTemplate @treeHandle="treeHandle" :datePickType="datePickType">
			<div slot="rightBtn">&nbsp;<el-button v-if="tableLevel === 2" @click="showReturn">返回</el-button></div>
			<Table
				:tableData="tableData"
				:tableHead="tableHead"
				:propKey="{ prop: 'id', label: 'name' }"
				:isUseSlot="false"
				:page="listQuery.page"
				:limit="listQuery.limit"
				v-loading="listLoading"
				:tableHeight="tableLevel === 1?'calc(100vh - 410px)' : 'calc(100vh - 280px)'"

			>
				<template slot="tool" slot-scope="{ data }">
					<el-button
						v-if="tableLevel === 1"
						style="padding:3px;"
						icon="el-icon-document"
						@click="detailTable(data.row)"
						type="text"
						>查看</el-button
					>
					<el-button
						v-if="tableLevel === 2"
						style="padding:3px;"
						icon="el-icon-document"
						@click="openDialog(data.row)"
						type="text"
						>查看</el-button
					>
				</template>
			</Table>
			<Pagination
				v-show="total > 0 && tableLevel === 1"
				:total="total"
				:page.sync="listQuery.page"
				:limit.sync="listQuery.limit"
				@pagination="getList"
			></Pagination>
		</AbnormalTemplate>
		<!-- 弹窗 -->
		<el-dialog
			:visible.sync="dialogFormVisible"
			width="600px"
		>
			<report-table
				:sourceTable="sourceForm"
				ref="reportSource"
				:reportTitle="reportSourceTitle"
				:isReadOnly="true"
				v-if="showSourceReport === 1"
			>
			</report-table>
			<report-table
				:sourceTable="deviceForm"
				ref="reportDevice"
				:reportTitle="reportDeviceTitle"
				:isReadOnly="true"
				v-if="showSourceReport === 0"
			>
			</report-table>
			<span slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="dialogFormVisible = false"
					>确 定</el-button
				>
			</span>
		</el-dialog>
	</div>
</template>

<script>
import RcimSourceStatistics from './index.js';
export default RcimSourceStatistics;
</script>

<style lang="scss" scoped>
@import "./index.scss";

</style>
<style lang="scss">
.staic_denger{
	color: red;
    box-shadow: 0 0 5px red inset;
}
</style>
